/*
 * @description:
 * @Author: lal
 * @Date: 2020-05-27 11:11:43
 * @LastEditors: lal
 * @LastEditTime: 2020-05-27 11:15:38
 */

const { ipcMain, dialog } = require("electron");

ipcMain.handle("open-information-dialog", async (event, opt) => {
  const defaultOptions = {
    type: "info",
    title: "Information",
    message: "This is an information dialog. Isn't it nice?",
    buttons: ["Yes", "No"],
  };
  let options = Object.assign(defaultOptions, opt);
  const result = await dialog.showMessageBox(options);
  return result;
});
